#include "thread_type_writer.h"

ThreadTypeWriter::ThreadTypeWriter(QObject *parent)
    : QThread{parent}, is_running_(false)
{

}

ThreadTypeWriter::~ThreadTypeWriter()
{

}

void ThreadTypeWriter::Stop()
{
    is_running_ = false;
}

void ThreadTypeWriter::run()
{
    is_running_ = true;

    msleep(200);
    QString::const_iterator c_iter = content_.constBegin();
    while(c_iter != content_.constEnd() && is_running_)
    {
        emit signal_put_char((*c_iter));
        msleep(50);
        ++c_iter;
    }
    is_running_ = false;
}
